Software compilers compile source code in a source language into target code in a target language. The target code may be executed directly by a data processing system or linked by a suitable linker with other target code for execution by the data processing system.
To help improve the execution of target code by the data processing system, one typical compiler performs optimization techniques based on the expected run-time usage of memory locations for the compiled program as defined by a store model or storage shape graph. The compiler may generate the store model by performing a pointer analysis to determine the effects of program statements referencing memory locations with constants, variables, or functions, for example.
One typical pointer analysis by type inference treats structured memory objects, such as structures or records, as single memory locations and may therefore generate an overly conservative store model. Another typical pointer analysis by type inference describes structured memory objects and elements of structured memory objects for a program by types based only on the type declarations of the program. Such a pointer analysis, however, produces inaccurate store models for programs using arbitrary type casts, unions, and pointer arithmetic.